/*
 * Profile.java
 *
 * Created on January 25, 2007, 6:04 PM
 *
 */

package d20chat;


/**
 * Stores basic information for a user profile.
 */
public class Profile 
{
    private String name = ""; //name of player (possibly real name, ie: Scott)
    private String email = ""; //email of player
    private String aboutMe = ""; //info about player
    private String website = ""; //website of player
    private String phone = ""; //phone of player
    private boolean visible = true; //is profile visible to others
    
    
    /**
     *Pass in variables to set members of the profile
     *ToDo: somehow set it so that it handles defaults
     *  for example, if they don't pass in variables, does it default to blank
     *  or does it default to whatever was already set?
     */
/**
     * Sets a profile up using many passed variables.
     * @param tname Users name (real name or pseudonym, different than username)
     * @param temail e-mail address of the user.
     * @param taboutMe Large text chunk including any additional information user wants to supply
     * @param twebsite Personal (or business) website of the user.
     * @param tphone Phone number of the user.
     * @param tvisible Toggle if the profile is visible to other users.
     */
    public void setProfile(String tname, String temail, String taboutMe, String twebsite, String tphone, boolean tvisible)
    {
        //todo: set these to default some how or another
        name = tname;
        email = temail;
        aboutMe = taboutMe;
        website = twebsite;
        phone = tphone;
        visible = tvisible;
    }
    
    
/**
     * Fetches name of the user.
     * @return Name of the user.
     */
    public String getName()
    {
        return name;
    }
    
    
/**
     * Fetches the e-mail address of the user.
     * @return e-mail of user.
     */
    public String getEmail()
    {
        return email;
    }
    
    
/**
     * Fetches additional text about the user.
     * @return aboutme text chunk.
     */
    public String getAboutMe()
    {
        return aboutMe;
    }
    
    
/**
     * Fetches the user's website
     * @return User's website.
     */
    public String getWebsite()
    {
        return website;
    }
    
    
/**
     * Fetches user's phone number
     * @return Phone number of user.
     */
    public String getPhone()
    {
        return phone;
    }
    
    
/**
     * Fetches if the user is visible or not.
     * @return visible value, false is not visible, true is visible.
     */
    public boolean getVisible()
    {
        return visible;
    }
    
    
    /**
     * What does this function do?
     *Does it get the players profile? Does it get someone ELSE'S profile?
     *What does it return, an array of strings listing off all the profile info?
     *Does it build it into a messagetoserver?
     */
/**
     * Fetches the entire profile of the user.
     * Returns it in one string, each section seperated by unicode character u8594
     * which is used to seperate the pieces out again when transfered across a
     * connection.
     * @return entire profile in a text string, each piece seperated by unicode u8594
     */
    public String getProfile()
    {
        
        String theString = "";
        theString = name + "\u8594" + email + "\u8594" + aboutMe + "\u8594" + website + "\u8594" + phone + "\u8594" + visible + "\u8594";
        return theString;
    }
/**
     * Sets profile to not being visible.
     */
    public void hide()
    {
        visible = false;
    }    

    /**
     * Class constructor for Profile.
     */
    public Profile() 
    {
    }
    
}
